package edu.egypt.seekbarsample;

import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.SeekBar;

public class SeekBarSampleActivity extends Activity {
    private SeekBar seekBar;
	private EditText editText;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        seekBar = (SeekBar)findViewById(R.id.seekBar1);
        editText = (EditText)findViewById(R.id.editText1);
        
        seekBar.setProgress((int)editText.getTextSize());
        
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
			
			@Override
			public void onStopTrackingTouch(SeekBar seekBar) {
			}
			
			@Override
			public void onStartTrackingTouch(SeekBar seekBar) {
			}
			
			@Override
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				editText.setTextSize(progress);
				
			}
		});
        
    }
}